home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / web_dev / files / mwjpp516.exe / %MAINDIR% / Tools / Html / insert Header 1.script < prev    next >
Encoding:
Text File  |  2001-06-19  |  849 b   |  33 lines

  1. !!Script
  2. // Copyright ⌐ 1997-1998 - Modelworks Software
  3.  
  4. /**
  5. @Tool: insert Header 1~wraps the current selection with 
  6. <H1> ... </H1> tags. 
  7. @EndTool: 
  8. @Summary: insert Header 1~wraps selection with the H1 tag
  9. */
  10.  
  11. function DoCommand()
  12. {
  13.     var editor = getActiveEditor();
  14.     if (editor)
  15.     {
  16.         var selection = editor.getSelection();
  17.         var upperCaseHtmlTags = getMapFileValue("Preferences", "Upper Case HTML Tags", true);
  18.         if(upperCaseHtmlTags)
  19.         {
  20.             editor.insert(selection.endLineIndex, selection.endCharIndex, "</H1>");
  21.             editor.insert(selection.startLineIndex, selection.startCharIndex, "<H1>");
  22.         }
  23.         else
  24.         {
  25.             editor.insert(selection.endLineIndex, selection.endCharIndex, "</h1>");
  26.             editor.insert(selection.startLineIndex, selection.startCharIndex, "<h1>");
  27.         }
  28.         editor.setActive();
  29.     }
  30. }
  31.  
  32. !!/Script
  33.